﻿using MS.InformationManagement.Presenter.Support;
using MS.InformationManagement.BLL.DocumentGenerator;

namespace MS.InformationManagement.Presenter.DocumentGenerator
{
    public class DocumentGeneratorPresenter : BasePresenter<IDocumentGeneratorView>
    {
        public DocumentGeneratorPresenter(IDocumentGeneratorView view) : base(view) { }

        public void HandleLoad() {
            int totalRecords;
            View.Templates = DocumentGeneratorBLL.GetTemplates(View.PageIndex, View.PageSize, out totalRecords);
            View.TotalRecords = totalRecords;
        }

        public void SearchTemplates() {
            int totalRecords;
            View.Templates = DocumentGeneratorBLL.FilterTemplates(View.TemplateSearchCriteria, View.PageIndex, View.PageSize, out totalRecords);
            View.TotalRecords = totalRecords;
        }
    }
}
